<?xml version="1.0" encoding="Windows-1250"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40">
  <xsl:output method="html" encoding="windows-1250"/>

  <xsl:template match="DPOutput">
  
  

  <p>
    <form action="?" method="post" name="prof" onsubmit="return check_prof(this)">
      <font size="+1">
        <b>User Settings</b>
      </font>
      <br>
        Here you may update your profile information.
      </br>

      <input type="hidden" name="dp" value="prof_upd"/>
      <p>
        <table>
          <tr>
            <td>
              <b>
                <font size="-1">Login: </font>
              </b>
              <font size="-2">Code used for identifying users upon login into the system.</font>
            </td>
          </tr>
          <tr>
            <td>
              <font color="#ff0000"><xsl:value-of select="BS_Person/login"/></font>
              <input type="hidden" name="bsxpersonlogin" value="{BS_Person/login}"/>
            </td>            
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">LDAP User: </font>
              </b>
              <font size="-2">Name under which the user is registered under the central LDAP. In case that this is defined the authentication is provided against the LDAP.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="text" name="bsxpersonldapuser" size="40" value="{BS_Person/ldapuser}"/>
            </td>            
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">Name: * </font>
              </b>
              <font size="-2">Name and last name of the user.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="text" name="bsxpersondescr" size="40" value="{BS_Person/descr}"/>
            </td>
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">E-Mail: * </font>
              </b>
              <font size="-2">Electronic mail address.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="text" name="bsxpersonemail" size="40" value="{BS_Person/email}"/>
            </td>
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">User level: * </font>
              </b>
              <font size="-2">(advanced users see description only in tooltips not directly on edit and create screens)</font>
            </td>
          </tr>          
          <tr>
            <td>          
              <select name="bsxpersonulevel">
                <option value="beg">
                  <xsl:if test="BS_Person/ulevel='beg'">
                    <xsl:attribute name="selected">true</xsl:attribute>
                  </xsl:if>
                  <xsl:text>Beginner</xsl:text>
                </option>
                <option value="adv">
                  <xsl:if test="not(BS_Person/ulevel) or BS_Person/ulevel='' or BS_Person/ulevel='adv'">
                    <xsl:attribute name="selected">true</xsl:attribute>
                  </xsl:if>
                  <xsl:text>Advanced</xsl:text>
                </option>
              </select>           
            </td>
          </tr>
          <tr>
            <td>
              <input type="submit" value="Confirm" size="30"/>
            </td>
          </tr>
        </table>
      </p>
    </form>

      <script language="JavaScript" type="text/javascript"><xsl:comment>document.prof.descr.focus();
           function check_prof(f)
           {
             if(!valText(f.bsxpersonlogin,"Login")) return false;
             if(!valText(f.bsxpersondescr,"Name")) return false;
             if(!valText(f.bsxpersonemail,"E-Mail")) return false;
             return true;
        }

        function valText(elem,nazev) {
        	var s=elem.value;
        	if (s.length==0 || countT(s, ' ')==s.length) {
        		alert("Must Enter: "+nazev);
        		elem.focus();
        		elem.select();
        		return false;			
        	} else 
        		return true;		 
        }
          
        function countT(s, charSet) 
        {
          var counter=0;
          for(i=0; i&lt;s.length; i++) 
          {
            if(charSet.indexOf(s.charAt(i)) > -1)
            counter++;
          }
          return counter;

        }//</xsl:comment></script>

  </p>

  <table border="0">
    <tr valign="top"><td>

  <p>

    <form action="?" method="post" name="pwd" onsubmit="return check_pwd(this)">
      <font size="+1">
        <b>Change Local Password</b>
      </font>
      <br>
        <font size="-1">
          Here you may change your local password. Local password is used only when the LDAP User entry is not
          filled and local authentication is done.
        </font>
      </br>

     <xsl:if test="DPParam[@name='res']='BADOLDPWD'">
       <p>
       <font color="#ff0000">Old password was wrong.</font>
       </p>
     </xsl:if>
     <xsl:if test="DPParam[@name='res']='OK'">
       <p>
       <font color="#ff0000">Password changed.</font>
       </p>
     </xsl:if>

      <input type="hidden" name="dp" value="pwd_upd"/>
      <p>
        <table>
          <tr>
            <td>
              <b>
                <font size="-1">Old Password: * </font>
              </b>
              <font size="-2">Old password used for login.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="password" name="pwd_old" size="40"/>
            </td>
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">New Password: * </font>
              </b>
              <font size="-2">Newly introduced password.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="password" name="pwd_upd" size="40"/>
            </td>
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">Repeat Password: * </font>
              </b>
              <font size="-2">Password validation.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="password" name="pwd_pom" size="40"/>
            </td>
          </tr>
          <tr>
            <td>
              <input type="submit" value="Change Password" size="30"/>
            </td>
          </tr>
        </table>
      </p>
    </form>

      <script language="JavaScript" type="text/javascript"><xsl:comment>
           function check_pwd(f)
           {
             if(!valText(f.pwd_old,"Old Password")) return false;
             if(!valText(f.pwd_upd,"New Password")) return false;
             if(!valText(f.pwd_pom,"Repeat Password")) return false;
             if(f.pwd_upd.value != f.pwd_pom.value)
             {
               alert("Badly repeated password");
               f.pwd_pom.value="";
               f.pwd_upd.value="";
               f.pwd_upd.focus();
               return false;
             }
             return true;
        }

  //</xsl:comment></script>

  </p>

  </td>
  <td>

  <p>

    <form action="?" method="post" name="change_login" onsubmit="return check_new_login(this)">
      <font size="+1">
        <b>Change Login</b>
      </font>
      <br>
        <font size="-1">
          Here you may change your system login. Login will not change if already existing
          one will be selected. Login may be same as the LDAP user name.
        </font>
      </br>

     <xsl:if test="DPParam[@name='msg']='login_changed'">
       <p>
         <font color="#ff0000">Login was changed.</font>
       </p>
     </xsl:if>
     <xsl:if test="DPParam[@name='msg']='badpwd'">
       <p>
         <font color="#ff0000">Bad password entered.</font>
       </p>
     </xsl:if>
     <xsl:if test="DPParam[@name='msg']='login_exists'">
       <p>
       <font color="#ff0000">Selected login is already in use.</font>
       </p>
     </xsl:if>

      <input type="hidden" name="dp" value="change_login"/>
      <p>
        <table>
          <tr>
            <td>
              <b>
                <font size="-1">New Login: * </font>
              </b>
              <font size="-2">Select new login.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="text" name="login" size="40"/>
            </td>
          </tr>
          <tr>
            <td>
              <b>
                <font size="-1">Password: * </font>
              </b>
              <font size="-2">Current password.</font>
            </td>
          </tr>
          <tr>
            <td>
               <input type="password" name="passwd" size="40"/>
            </td>
          </tr>
          <tr>
            <td>
              <input type="submit" value="Change Login" size="30"/>
            </td>
          </tr>
        </table>
      </p>
    </form>

      <script language="JavaScript" type="text/javascript"><xsl:comment>
           function check_new_login(f)
           {
             if(!valText(f.login,"New Login")) return false;
             if(!valText(f.passwd,"Password")) return false;
             return true;
        }

  //</xsl:comment></script>

  </p>
  </td>
  </tr>
  </table>
  
  </xsl:template>

  <xsl:template name="title">User Profile</xsl:template>


</xsl:stylesheet>